import {Component, Input, OnInit, OnChanges} from '@angular/core';

@Component({
  selector: 'app-head',
  templateUrl: './head.component.html',
  styleUrls: ['./head.component.scss']
})
export class HeadComponent implements OnInit, OnChanges {
  public title: any;
  public more: any;
  public cancel: any;
  @Input() msg: any;
  @Input() msg1: any;
  constructor() {
  }
  ngOnChanges() {
    this.title = this.msg1;
    // 显示更多图片
    this.more = this.msg.more;
    // 取消图片
    this.cancel = this.msg.cancel;
  }
  ngOnInit() {
  }
  goback() {
    // 返回上一层
    if ( this.title === '宿苜草商城') {
      history.go(0);
    } else {
      history.go(-1);
    }
  }
}
